package com.neuedu.demo3;

import java.util.Scanner;

public class Homework12 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = sc.nextInt();
        int result = 1;//1乘任何数都等这个数
        for (int i = 1; i <= num; i++) {
            result = result * i;//求阶乘的结果
        }
        System.out.println(result);//打印最终结果
    }
}
